package com.bosssoft.trainee.nontax.util.mapper.poDto;

import com.bosssoft.trainee.nontax.entity.dto.PermissionDto;
import com.bosssoft.trainee.nontax.entity.po.Permission;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @Description: permission dto po transform util class
 * @Author: Luo WenLong
 * @Date: 2022/6/25 9:02
 */
@Mapper(componentModel = "spring")
public interface PermissionPoDto {
    /*
     * @Description: po to dto
     * @param permission
     * @return: com.bosssoft.trainee.nontax.entity.dto.PermissionDto
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    PermissionDto po2dto(Permission permission);

    /*
     * @Description: po to dto
     * @param permissions
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.dto.PermissionDto>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    List<PermissionDto> po2dto(List<Permission> permissions);

    /*
     * @Description: dto to po
     * @param permissionDto
     * @return: com.bosssoft.trainee.nontax.entity.po.Permission
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    @Mappings({
            @Mapping(target = "updateTime", source = "")
    })
    Permission dto2po(PermissionDto permissionDto);
    /**
     * @Description: dto to po
     * @param permissionDtos
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.po.Permission>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:06
     */
    List<Permission> dto2po(List<PermissionDto> permissionDtos);
}
